$(function(){
 let $progress = $('#progress'),
     $start = $('#start'),
     $suspend = $('#suspend'),
     $reset = $('#reset');
 let max   = $progress.max,
     timer = null;

 $start.click(()=>{
   var value = $progress.val();
   if(value < 100){
     timer = setInterval(()=>{
      value += 1;
      $progress.val(value);
     },30)
   }
   if(value == 100){
     clearInterval(timer);
   }
 });
 $suspend.click(()=>{
   clearInterval(timer);
 });
 $reset.click(()=>{
   var value = $progress.val();
   if(value !== 100){
     $progress.val(0);
   }
   if(value === 100){
     value = 0;
     timer = setInterval(()=>{
      value += 1;
      $progress.val(value);
     },30)
   }
 })
});
